<script type="text/javascript">
{literal}

	function validateForm()
	{
		var _o = $('#editProfile').valid();	
		if(_o == false)
		{ //saveSettings
			$('#actiontype').val('saveSettings');
		}
		return _o;
	}

$(document).ready(function(){
	$('#uploadAvatar').click(function(){
{/literal}
		MFcropper('{url label=uploadAvatar type=avatar}');
{literal}
	});

	var defSet = $('#editProfile').validate().settings;
	var defRules = {};
	var pswRules = {};
	var emlRules = {};
	$.each(defSet.rules, function(i, e){
		var next = new Object();
		next[i] = e;
		if((i == 'password') || (i == 'password2'))
		{
			pswRules = $.extend(true, pswRules, next);
		} else if (i == 'email'){
			emlRules = $.extend(true, emlRules, next);
		} else {
			defRules = $.extend(true, defRules, next);
		}
	});

	defSet.rules = {};
	$('#editProfile').validate(defSet);
	
	$('input[name="saveSettings"]').click(function(){
		$('#actiontype').val('saveSettings');
		defSet.rules = defRules;
		$('#editProfile').validate(defSet);
		return validateForm();
	});	
	
	$('input[name="changePassword"]').click(function(){
		$('#actiontype').val('changePassword');
		defSet.rules = pswRules;
		$('#editProfile').validate(defSet);
		return validateForm();
	});		

	$('input[name="changeEmail"]').click(function(){
		$('#actiontype').val('changeEmail');
		defSet.rules = emlRules;
		$('#editProfile').validate(defSet);
		return validateForm();	
	});
	
	$('input[name="extendedProfile"]').click(function(){
		$('#actiontype').val('extendedProfile');
		defSet.rules = {};
		$('#editProfile').validate(defSet);
		return validateForm();		
	});	
	
	
});
{/literal}
</script>
<form action="{url label=editProfile}" method="post" id="editProfile">
		<input type="hidden" id="actiontype" name="actiontype" value="saveSettings" />
		
		<div class="panelTabs">
			<div class="tabs">
				<a class="label" title="{'User profile'|t}">{'User profile'|t}</a>
			</div>
		</div>
		<div class="backgroundFrame970Top"></div>
		<div class="backgroundFrame970">
			<br/>
		
		
		
			<div class="panelUserEdit panelUserEdit50">
				<div class="avatar">
					<img id="avatar" src="{$urlStatic}/{image src=$userObj->getAvatar() w=150 h=150}" title="{$userObj->getFirstName()} {$userObj->getLastName()}" alt="{$userObj->getFirstName()} {$userObj->getLastName()}"/><br/>
					<input type="button" name="avatarEdit" class="button" value="upload avatar" id="uploadAvatar"/>
				</div>
			
				<div class="formItem">
					<p class="label">{'Name'|t}</p>
					<input type="text" value="{$userObj->getFirstName()}" name="first_name" class="defInTxt"/>
				</div>
				
				<div class="formItem">
					<p class="label">{'Family name'|t}</p>
					<input type="text" value="{$userObj->getLastName()}" name="last_name" class="defInTxt"/>
				</div>
				<div class="formItem">
					<p class="label">{'Gender'|t}</p>
					<input type="radio" name="gender" value="1" id="male" {if $userObj->getGender() eq 1}checked="checked"{/if}/><label for="male">male</label>
					<input type="radio" name="gender" value="2" id="female" {if $userObj->getGender() eq 2}checked="checked"{/if}/><label for="male">female</label>
				</div>
				<div class="clearBoth"></div>
			</div>
			
			
			<div class="panelUserEdit panelUserEditLast">
				<div class="formItem">
					<p class="label">{'Email address'|t}</p>
					<input type="text" value="{$userObj->getEmail()}" name="email" class="defInTxt email"/> <input type="submit" value="{'change'|t}" class="button" name="changeEmail"/>
				</div>
				
				<div class="formItem">
					<p class="label">{'Password / password repeat'|t}</p>
					<div class="password">
						<input type="password" value="password" name="password" id="password" class="defInTxt"/>
						<input type="password" value="password" name="password2" id="password2" class="defInTxt"/>
						<input type="submit" value="{'change password'|t}" name="changePassword" class="button"/>
					</div>
				</div>
			</div>
			<div class="clearBoth"></div>
			
			
			<div class="panelUserEdit panelUserEdit13">
				<script type="text/javascript">
				{literal}	
				function changeCalendarDays(year, month)
				{
					var days = 31;
					if(month == 3 || month == 5 || month == 8 || month == 10)
					{
						days = 30;
					} else if(month == 1)
					{
						if((year % 100 != 0) && (year % 4 == 0))
						{
							days = 29;	
						} else {
							days = 28;
						}
					}
					var options = $('select[name="day"] option');				
					if(options.length > days)
					{
						$(options).each(function(index, element){
							if((index + 1) > days)
							{
								$(element).remove();
							}
						});
					} else if(options.length < days)
					{
						for(i = options.length + 1; i <= days; i++)
						{
							$('select[name="day"]').append('<option value="' + i + '">' + i + '</option>');
						}
					}
				}
					
				$(function(){
					var month = $('select[name="month"]').attr("selectedIndex");
					var year = $('select[name="year"] option:selected').attr('value');
					changeCalendarDays(year, month);
					$('.calendarItem').change(function(){
						if($(this).attr('name') == 'month')
						{
							month = $(this).attr("selectedIndex");

						}
						
						if($(this).attr('name') == 'year')
						{
							year = $('select[name="year"] option:selected').attr('value');
						}
						changeCalendarDays(year, month);
					});
				});
				{/literal}
				</script>
				<div class="formItem">
					<p class="label">{'birthdate'|t}</p>
					<select name="month" class="defSelect calendarItem">
						<option value="01" {if $userDate.1 eq "01"}selected="selected"{/if}>{'January'|t}</option>
						<option value="02" {if $userDate.1 eq "02"}selected="selected"{/if}>{'February'|t}</option>
						<option value="03" {if $userDate.1 eq "03"}selected="selected"{/if}>{'March'|t}</option>
						<option value="04" {if $userDate.1 eq "04"}selected="selected"{/if}>{'April'|t}</option>
						<option value="05" {if $userDate.1 eq "05"}selected="selected"{/if}>{'May'|t}</option>
						<option value="06" {if $userDate.1 eq "06"}selected="selected"{/if}>{'June'|t}</option>
						<option value="07" {if $userDate.1 eq "07"}selected="selected"{/if}>{'July'|t}</option>
						<option value="08" {if $userDate.1 eq "08"}selected="selected"{/if}>{'August'|t}</option>
						<option value="09" {if $userDate.1 eq "09"}selected="selected"{/if}>{'September'|t}</option>
						<option value="10" {if $userDate.1 eq "10"}selected="selected"{/if}>{'October'|t}</option>
						<option value="11" {if $userDate.1 eq "11"}selected="selected"{/if}>{'November'|t}</option>
						<option value="12" {if $userDate.1 eq "12"}selected="selected"{/if}>{'December'|t}</option>
					</select>
					
					<select name="day" class="defSelect">
						{section name=day start=1 loop=32 step=1}
						<option value="{$smarty.section.day.index|string_format:"%02d"}" {if $userDate.2 eq $smarty.section.day.index}selected="selected"{/if}>{$smarty.section.day.index|string_format:"%02d"}</option>
						{/section}
					</select>
					
					<select name="year" class="defSelect calendarItem">
						{section name=year loop=2012 max=50 step=-1}
						<option value="{$smarty.section.year.index|string_format:"%04d"}" {if $userDate.0 eq $smarty.section.year.index}selected="selected"{/if}>{$smarty.section.year.index|string_format:"%04d"}</option>
						{/section}
					</select>
					
					
					
					
				</div>
				
				<div class="formItem formItemFl">
					<p class="label">{if $_display_metric_system_type eq 1}{'weight [lb]'|t}{else}{'weight [kg]'|t}{/if}</p>
					<input type="text" id="weight" name="weight" value="{$userObj->getWeight()}" class="defInTxt" maxlength="3" />
				</div>
				
				<div class="formItem formItemFl">
					<p class="label">{if $_display_metric_system_type eq 1}{'height [in]'|t}{else}{'height [cm]'|t}{/if}</p>
					<input type="text" id="height" name="height" value="{$userObj->getHeight()}" class="defInTxt" maxlength="3"/>
				</div>
				<div class="clearBoth"></div>		
				
				<div class="formItem">
					{literal}<script type="text/javascript">
						$(function() {
							$('#ntrp').sliders({min_value: 1, max_value:7, value_type: 'float', label:'NTRP', scale_image: '{/literal}{$urlStatic}/image/Strona/ruler17.png{literal}', bg_image: '{/literal}{$urlStatic}/image/Strona/rainbow.png{literal}'});
						})
					</script>{/literal}					
					<input type="hidden" name="ntrp" id="ntrp" value="{if $extUserProf->getNtrp() gt 0}{$extUserProf->getNtrp()}{else}1{/if}"/>
				</div>
			
			</div>
			
			<div class="panelUserEdit panelUserEdit13">

				<div class="formItem">
					<p class="label">{'Country'|t}</p>
					<select name="location" class="defSelect defSelectCountry" id="locationField">
					<option value="">{'--- please select ---'|t}</option>
						<option value='Afghanistan'>{'Afghanistan'|t}</option>
						<option value='Aland Islands'>{'Aland Islands'|t}</option>
						<option value='Albania'>{'Albania'|t}</option>
						<option value='Algeria'>{'Algeria'|t}</option>
						<option value='American Samoa'>{'American Samoa'|t}</option>
						<option value='Andorra'>{'Andorra'|t}</option>
						<option value='Angola'>{'Angola'|t}</option>
						<option value='Anguilla'>{'Anguilla'|t}</option>
						<option value='Antarctica'>{'Antarctica'|t}</option>
						<option value='Antigua and Barbuda'>{'Antigua and Barbuda'|t}</option>
						<option value='Argentina'>{'Argentina'|t}</option>
						<option value='Armenia'>{'Armenia'|t}</option>
						<option value='Aruba'>{'Aruba'|t}</option>
						<option value='Australia'>{'Australia'|t}</option>
						<option value='Austria'>{'Austria'|t}</option>
						<option value='Azerbaijan'>{'Azerbaijan'|t}</option>
						<option value='Bahamas'>{'Bahamas'|t}</option>
						<option value='Bahrain'>{'Bahrain'|t}</option>
						<option value='Bangladesh'>{'Bangladesh'|t}</option>
						<option value='Barbados'>{'Barbados'|t}</option>
						<option value='Belarus'>{'Belarus'|t}</option>
						<option value='Belgium'>{'Belgium'|t}</option>
						<option value='Belize'>{'Belize'|t}</option>
						<option value='Benin'>{'Benin'|t}</option>
						<option value='Bermuda'>{'Bermuda'|t}</option>
						<option value='Bhutan'>{'Bhutan'|t}</option>
						<option value='Bolivia'>{'Bolivia'|t}</option>
						<option value='Bosnia and Herzegovina'>{'Bosnia and Herzegovina'|t}</option>
						<option value='Botswana'>{'Botswana'|t}</option>
						<option value='Bouvet Island'>{'Bouvet Island'|t}</option>
						<option value='Brazil'>{'Brazil'|t}</option>
						<option value='British Indian Ocean Territory'>{'British Indian Ocean Territory'|t}</option>
						<option value='British Virgin Islands'>{'British Virgin Islands'|t}</option>
						<option value='Brunei'>{'Brunei'|t}</option>
						<option value='Bulgaria'>{'Bulgaria'|t}</option>
						<option value='Burkina Faso'>{'Burkina Faso'|t}</option>
						<option value='Burundi'>{'Burundi'|t}</option>
						<option value='Cambodia'>{'Cambodia'|t}</option>
						<option value='Cameroon'>{'Cameroon'|t}</option>
						<option value='Canada'>{'Canada'|t}</option>
						<option value='Cape Verde'>{'Cape Verde'|t}</option>
						<option value='Cayman Islands'>{'Cayman Islands'|t}</option>
						<option value='Central African Republic'>{'Central African Republic'|t}</option>
						<option value='Chad'>{'Chad'|t}</option>
						<option value='Chile'>{'Chile'|t}</option>
						<option value='China'>{'China'|t}</option>
						<option value='Christmas Island'>{'Christmas Island'|t}</option>
						<option value='Cocos (Keeling) Islands'>{'Cocos (Keeling) Islands'|t}</option>
						<option value='Colombia'>{'Colombia'|t}</option>
						<option value='Comoros'>{'Comoros'|t}</option>
						<option value='Congo'>{'Congo'|t}</option>
						<option value='Cook Islands'>{'Cook Islands'|t}</option>
						<option value='Costa Rica'>{'Costa Rica'|t}</option>
						<option value='Croatia'>{'Croatia'|t}</option>
						<option value='Cuba'>{'Cuba'|t}</option>
						<option value='Cyprus'>{'Cyprus'|t}</option>
						<option value='Czech Republic'>{'Czech Republic'|t}</option>
						<option value='Democratic Republic of Congo'>{'Democratic Republic of Congo'|t}</option>
						<option value='Denmark'>{'Denmark'|t}</option>
						<option value='Disputed Territory'>{'Disputed Territory'|t}</option>
						<option value='Djibouti'>{'Djibouti'|t}</option>
						<option value='Dominica'>{'Dominica'|t}</option>
						<option value='Dominican Republic'>{'Dominican Republic'|t}</option>
						<option value='East Timor'>{'East Timor'|t}</option>
						<option value='Ecuador'>{'Ecuador'|t}</option>
						<option value='Egypt'>{'Egypt'|t}</option>
						<option value='El Salvador'>{'El Salvador'|t}</option>
						<option value='Equatorial Guinea'>{'Equatorial Guinea'|t}</option>
						<option value='Eritrea'>{'Eritrea'|t}</option>
						<option value='Estonia'>{'Estonia'|t}</option>
						<option value='Ethiopia'>{'Ethiopia'|t}</option>
						<option value='Falkland Islands'>{'Falkland Islands'|t}</option>
						<option value='Faroe Islands'>{'Faroe Islands'|t}</option>
						<option value='Federated States of Micronesia'>{'Federated States of Micronesia'|t}</option>
						<option value='Fiji'>{'Fiji'|t}</option>
						<option value='Finland'>{'Finland'|t}</option>
						<option value='France'>{'France'|t}</option>
						<option value='French Guyana'>{'French Guyana'|t}</option>
						<option value='French Polynesia'>{'French Polynesia'|t}</option>
						<option value='French Southern Territories'>{'French Southern Territories'|t}</option>
						<option value='Gabon'>{'Gabon'|t}</option>
						<option value='Gambia'>{'Gambia'|t}</option>
						<option value='Georgia'>{'Georgia'|t}</option>
						<option value='Germany'>{'Germany'|t}</option>
						<option value='Ghana'>{'Ghana'|t}</option>
						<option value='Gibraltar'>{'Gibraltar'|t}</option>
						<option value='Greece'>{'Greece'|t}</option>
						<option value='Greenland'>{'Greenland'|t}</option>
						<option value='Grenada'>{'Grenada'|t}</option>
						<option value='Guadeloupe'>{'Guadeloupe'|t}</option>
						<option value='Guam'>{'Guam'|t}</option>
						<option value='Guatemala'>{'Guatemala'|t}</option>
						<option value='Guinea'>{'Guinea'|t}</option>
						<option value='Guinea-Bissau'>{'Guinea-Bissau'|t}</option>
						<option value='Guyana'>{'Guyana'|t}</option>
						<option value='Haiti'>{'Haiti'|t}</option>
						<option value='Heard Island and Mcdonald Islands'>{'Heard Island and Mcdonald Islands'|t}</option>
						<option value='Honduras'>{'Honduras'|t}</option>
						<option value='Hong Kong'>{'Hong Kong'|t}</option>
						<option value='Hungary'>{'Hungary'|t}</option>
						<option value='Iceland'>{'Iceland'|t}</option>
						<option value='India'>{'India'|t}</option>
						<option value='Indonesia'>{'Indonesia'|t}</option>
						<option value='Iran'>{'Iran'|t}</option>
						<option value='Iraq'>{'Iraq'|t}</option>
						<option value='Iraq-Saudi Arabia Neutral Zone'>{'Iraq-Saudi Arabia Neutral Zone'|t}</option>
						<option value='Ireland'>{'Ireland'|t}</option>
						<option value='Israel'>{'Israel'|t}</option>
						<option value='Italy'>{'Italy'|t}</option>
						<option value='Ivory Coast'>{'Ivory Coast'|t}</option>
						<option value='Jamaica'>{'Jamaica'|t}</option>
						<option value='Japan'>{'Japan'|t}</option>
						<option value='Jordan'>{'Jordan'|t}</option>
						<option value='Kazakhstan'>{'Kazakhstan'|t}</option>
						<option value='Kenya'>{'Kenya'|t}</option>
						<option value='Kiribati'>{'Kiribati'|t}</option>
						<option value='Kuwait'>{'Kuwait'|t}</option>
						<option value='Kyrgyzstan'>{'Kyrgyzstan'|t}</option>
						<option value='Laos'>{'Laos'|t}</option>
						<option value='Latvia'>{'Latvia'|t}</option>
						<option value='Lebanon'>{'Lebanon'|t}</option>
						<option value='Lesotho'>{'Lesotho'|t}</option>
						<option value='Liberia'>{'Liberia'|t}</option>
						<option value='Libya'>{'Libya'|t}</option>
						<option value='Liechtenstein'>{'Liechtenstein'|t}</option>
						<option value='Lithuania'>{'Lithuania'|t}</option>
						<option value='Luxembourg'>{'Luxembourg'|t}</option>
						<option value='Macau'>{'Macau'|t}</option>
						<option value='Macedonia'>{'Macedonia'|t}</option>
						<option value='Madagascar'>{'Madagascar'|t}</option>
						<option value='Malawi'>{'Malawi'|t}</option>
						<option value='Malaysia'>{'Malaysia'|t}</option>
						<option value='Maldives'>{'Maldives'|t}</option>
						<option value='Mali'>{'Mali'|t}</option>
						<option value='Malta'>{'Malta'|t}</option>
						<option value='Marshall Islands'>{'Marshall Islands'|t}</option>
						<option value='Martinique'>{'Martinique'|t}</option>
						<option value='Mauritania'>{'Mauritania'|t}</option>
						<option value='Mauritius'>{'Mauritius'|t}</option>
						<option value='Mayotte'>{'Mayotte'|t}</option>
						<option value='Mexico'>{'Mexico'|t}</option>
						<option value='Moldova'>{'Moldova'|t}</option>
						<option value='Monaco'>{'Monaco'|t}</option>
						<option value='Mongolia'>{'Mongolia'|t}</option>
						<option value='Montserrat'>{'Montserrat'|t}</option>
						<option value='Morocco'>{'Morocco'|t}</option>
						<option value='Mozambique'>{'Mozambique'|t}</option>
						<option value='Myanmar'>{'Myanmar'|t}</option>
						<option value='Namibia'>{'Namibia'|t}</option>
						<option value='Nauru'>{'Nauru'|t}</option>
						<option value='Nepal'>{'Nepal'|t}</option>
						<option value='Netherlands'>{'Netherlands'|t}</option>
						<option value='Netherlands Antilles'>{'Netherlands Antilles'|t}</option>
						<option value='New Caledonia'>{'New Caledonia'|t}</option>
						<option value='New Zealand'>{'New Zealand'|t}</option>
						<option value='Nicaragua'>{'Nicaragua'|t}</option>
						<option value='Niger'>{'Niger'|t}</option>
						<option value='Nigeria'>{'Nigeria'|t}</option>
						<option value='Niue'>{'Niue'|t}</option>
						<option value='Norfolk Island'>{'Norfolk Island'|t}</option>
						<option value='North Korea'>{'North Korea'|t}</option>
						<option value='Northern Mariana Islands'>{'Northern Mariana Islands'|t}</option>
						<option value='Norway'>{'Norway'|t}</option>
						<option value='Oman'>{'Oman'|t}</option>
						<option value='Pakistan'>{'Pakistan'|t}</option>
						<option value='Palau'>{'Palau'|t}</option>
						<option value='Palestinian Territories'>{'Palestinian Territories'|t}</option>
						<option value='Panama'>{'Panama'|t}</option>
						<option value='Papua New Guinea'>{'Papua New Guinea'|t}</option>
						<option value='Paraguay'>{'Paraguay'|t}</option>
						<option value='Peru'>{'Peru'|t}</option>
						<option value='Philippines'>{'Philippines'|t}</option>
						<option value='Pitcairn Islands'>{'Pitcairn Islands'|t}</option>
						<option value='Poland'>{'Poland'|t}</option>
						<option value='Portugal'>{'Portugal'|t}</option>
						<option value='Puerto Rico'>{'Puerto Rico'|t}</option>
						<option value='Qatar'>{'Qatar'|t}</option>
						<option value='Reunion'>{'Reunion'|t}</option>
						<option value='Romania'>{'Romania'|t}</option>
						<option value='Russia'>{'Russia'|t}</option>
						<option value='Rwanda'>{'Rwanda'|t}</option>
						<option value='Saint Helena and Dependencies'>{'Saint Helena and Dependencies'|t}</option>
						<option value='Saint Kitts and Nevis'>{'Saint Kitts and Nevis'|t}</option>
						<option value='Saint Lucia'>{'Saint Lucia'|t}</option>
						<option value='Saint Pierre and Miquelon'>{'Saint Pierre and Miquelon'|t}</option>
						<option value='Saint Vincent and the Grenadines'>{'Saint Vincent and the Grenadines'|t}</option>
						<option value='Samoa'>{'Samoa'|t}</option>
						<option value='San Marino'>{'San Marino'|t}</option>
						<option value='Sao Tome and Principe'>{'Sao Tome and Principe'|t}</option>
						<option value='Saudi Arabia'>{'Saudi Arabia'|t}</option>
						<option value='Senegal'>{'Senegal'|t}</option>
						<option value='Seychelles'>{'Seychelles'|t}</option>
						<option value='Sierra Leone'>{'Sierra Leone'|t}</option>
						<option value='Singapore'>{'Singapore'|t}</option>
						<option value='Slovakia'>{'Slovakia'|t}</option>
						<option value='Slovenia'>{'Slovenia'|t}</option>
						<option value='Solomon Islands'>{'Solomon Islands'|t}</option>
						<option value='Somalia'>{'Somalia'|t}</option>
						<option value='South Africa'>{'South Africa'|t}</option>
						<option value='South Georgia and South Sandwich Islands'>{'South Georgia and South Sandwich Islands'|t}</option>
						<option value='South Korea'>{'South Korea'|t}</option>
						<option value='Spain'>{'Spain'|t}</option>
						<option value='Spratly Islands'>{'Spratly Islands'|t}</option>
						<option value='Sri Lanka'>{'Sri Lanka'|t}</option>
						<option value='Sudan'>{'Sudan'|t}</option>
						<option value='Suriname'>{'Suriname'|t}</option>
						<option value='Svalbard and Jan Mayen'>{'Svalbard and Jan Mayen'|t}</option>
						<option value='Swaziland'>{'Swaziland'|t}</option>
						<option value='Sweden'>{'Sweden'|t}</option>
						<option value='Switzerland'>{'Switzerland'|t}</option>
						<option value='Syria'>{'Syria'|t}</option>
						<option value='Taiwan'>{'Taiwan'|t}</option>
						<option value='Tajikistan'>{'Tajikistan'|t}</option>
						<option value='Tanzania'>{'Tanzania'|t}</option>
						<option value='Thailand'>{'Thailand'|t}</option>
						<option value='Togo'>{'Togo'|t}</option>
						<option value='Tokelau'>{'Tokelau'|t}</option>
						<option value='Tonga'>{'Tonga'|t}</option>
						<option value='Trinidad and Tobago'>{'Trinidad and Tobago'|t}</option>
						<option value='Tunisia'>{'Tunisia'|t}</option>
						<option value='Turkey'>{'Turkey'|t}</option>
						<option value='Turkmenistan'>{'Turkmenistan'|t}</option>
						<option value='Turks And Caicos Islands'>{'Turks And Caicos Islands'|t}</option>
						<option value='Tuvalu'>{'Tuvalu'|t}</option>
						<option value='Uganda'>{'Uganda'|t}</option>
						<option value='Ukraine'>{'Ukraine'|t}</option>
						<option value='United Arab Emirates'>{'United Arab Emirates'|t}</option>
						<option value='United Kingdom'>{'United Kingdom'|t}</option>
						<option value='United States'>{'United States'|t}</option>
						<option value='United States Minor Outlying Islands'>{'United States Minor Outlying Islands'|t}</option>
						<option value='Uruguay'>{'Uruguay'|t}</option>
						<option value='US Virgin Islands'>{'US Virgin Islands'|t}</option>
						<option value='Uzbekistan'>{'Uzbekistan'|t}</option>
						<option value='Vanuatu'>{'Vanuatu'|t}</option>
						<option value='Vatican City'>{'Vatican City'|t}</option>
						<option value='Venezuela'>{'Venezuela'|t}</option>
						<option value='Vietnam'>{'Vietnam'|t}</option>
						<option value='Wallis and Futuna'>{'Wallis and Futuna'|t}</option>
						<option value='Western Sahara'>{'Western Sahara'|t}</option>
						<option value='Yemen'>{'Yemen'|t}</option>
						<option value='Zambia'>{'Zambia'|t}</option>
						<option value='Zimbabwe'>{'Zimbabwe'|t}</option>
						<option value='Serbia'>{'Serbia'|t}</option>
						<option value='Montenegro'>{'Montenegro'|t}</option>
					</select>
					
				<script type="text/javascript">
					var loc = '{$userObj->getLocation()}';
					{literal}
					$(document).ready(function(){
						if(loc.length > 1)
						{
							$('#locationField option[value="' + loc + '"]').attr('selected', 'selected');
						}						
					});
					{/literal}
				</script>					
					
				</div>
				<div class="formItem">
					<p class="label">{'State'|t}</p>
					<input type="text" name="state" value="{$userObj->getState()}" class="defInTxt"/>
				</div>
				<div class="formItem">
					<p class="label">{'City'|t}</p>
					<input type="text" name="city" value="{$userObj->getCity()}" class="defInTxt"/>
				</div>
				
				<!-- 
				<div class="formItem">
					<p class="label">Preffered portal language</p>
					<input type="radio" name="language" id="en" /><label for="en">English</label>
					<input type="radio" name="language" id="gr" /><label for="gr">German</label>
					<input type="radio" name="language" id="fr" /><label for="fr">Franch</label>
					<input type="radio" name="language" id="ru" /><label for="ru">Russian</label>
					<input type="radio" name="language" id="pl" /><label for="ru">Polish</label>
				</div>
				-->
			</div>
			<div class="panelUserEdit panelUserEdit13 panelUserEditLast">
				<div class="formItem">
					<p class="label">{'Measurement Units'|t}</p>
					<input type="radio" name="values_metric" value="0" id="metric"  {if $userObj->getValuesMetric() eq 0}checked="checked"{/if}/><label for="metric">{'metric (EU)'|t}</label>
					<input type="radio" name="values_metric" value="1" id="imperial"  {if $userObj->getValuesMetric() eq 1}checked="checked"{/if}/><label for="imperial">{'imperial (US)'|t}</label>
				</div>
				
				<div class="formItem">
					<p class="label">{'Price compare'|t}</p>
					<input type="radio" name="price_compare" value="1" id="pcShow" {if $userObj->getPriceCompare() eq 1}checked="checked"{/if} /><label for="pcShow">{'show'|t}</label>
					<input type="radio" name="price_compare" value="0" id="pcHide" {if $userObj->getPriceCompare() eq 0}checked="checked"{/if}/><label for="pcHide">{'hide'|t}</label>
				</div>
				{if $userObj->getPremium() eq 1}
				<div class="formItem">
					<p class="label">{'Looking for tennis parnter'|t}</p>
					<input type="radio" name="looking_for_partner" value="1" id="l4tpY" {if $userObj->getLookingForPartner() eq 1}checked="checked"{/if}/><label for="l4tpY">{'yes'|t}</label>
					<input type="radio" name="looking_for_partner" value="0" id="l4tpN" {if $userObj->getLookingForPartner() eq 0}checked="checked"{/if}/><label for="l4tpN">{'no'|t}</label>
				</div>
				{else}
				<a href="{url label=buyPremium}">{'Buy premium account'|t}</a>
				{/if}
			</div>
		<div class="clearBoth"></div>
		
		
		
		
		
		
		</div>
		<div class="backgroundFrame970Bottom"></div>
		<div class="submitGroup">
			<input type="submit" value="{'save settings'|t}" name="saveSettings" class="button"/>
		</div>
		
		<br/>
		
		<div class="panel310">
			<div class="panelTabs">
				<div class="tabs">
					<a class="label" title="{'Player profile'|t}">{'Player profile'|t}</a>
				</div>
			</div>
			<div class="backgroundFrame310Top"></div>
			<div class="backgroundFrame310"><div class="playerProfileContentEdit">
				<table cellpadding="0" cellspacing="0" align="center" class="panelProfle" width="280" border="0">
					<tr><td class="label">{'Grip size'|t}</td><td>
								<select name="grip_size" class="defInTxt">
								{foreach from=$gripSize item=size}
								<option {if $extUserProf->getGripSize() eq $size}selected="selected"{/if}}>{$size}</option>
								{/foreach}
								</select>							
						</td></tr>
					<tr><td class="label">{'Shoe size'|t}</td><td>
								<select name="shoe_size">
								{foreach from=$shoeSize item=size}
								<option {if $extUserProf->getShoeSize() eq $size}selected="selected"{/if}>{$size}</option>
								{/foreach}
								</select>							
						</td></tr>
					<tr><td class="label">{'Apparel size'|t}</td><td>
								<select name="apparel_size">
								{foreach from=$apparelSize item=size}
								<option {if $extUserProf->getApparelSize() eq $size}selected="selected"{/if}>{$size}</option>
								{/foreach}
								</select>							
						</td></tr>
				</table>
			</div></div>
			<div class="backgroundFrame310Bottom"></div>
			<div class="submitGroup">
				<input type="submit" value="{'save settings'|t}" name="extendedProfile" class="button"/>
			</div>
		</div>
		
		
		
		<div class="panel640">
			<div class="panelTabs">
				<div class="tabs">
					<a class="label" title="{'Extended profile'|t}">{'Extended profile'|t}</a>
				</div>
			</div>
			<div class="backgroundFrame640Top"></div>
			<div class="backgroundFrame640"><div class="playerProfileContentEdit">
				<table cellpadding="0" cellspacing="0" class="panelProfle panelProfileTabL" width="230" border="0">
					<tr><td class="label">{'Hand'|t}</td><td><select name="hand" class="defSelect">
								<option value="1" {if $extUserProf->getHand() eq 1}selected="selected"{/if}>{'Left'|t}</option>
								<option value="2" {if $extUserProf->getHand() eq 2}selected="selected"{/if}>{'Right'|t}</option>
							</select></td></tr>
					<tr><td class="label">{'Forehand'|t}</td><td>
							<select name="forehand" class="defSelect">
								<option value="1" {if $extUserProf->getForehand() eq 1}selected="selected"{/if}>{'1 handed'|t}</option>
								<option value="2" {if $extUserProf->getForehand() eq 2}selected="selected"{/if}>{'2 handed'|t}</option>
							</select></td></tr>
					<tr><td class="label">{'Backhand'|t}</td><td><select name="backhand" class="defSelect">
								<option value="1" {if $extUserProf->getBackhand() eq 1}selected="selected"{/if}>{'1 handed'|t}</option>
								<option value="2" {if $extUserProf->getBackhand() eq 2}selected="selected"{/if}>{'2 handed'|t}</option>
							</select></td></tr>
				</table>
				
				<table cellpadding="0" cellspacing="0" class="panelProfle  panelProfileTabR" width="360" border="0">
					<tr><td class="label">{'Player Style'|t}</td><td>
							<select name="player_style" class="defSelect">
								<option value="1" {if $extUserProf->getPlayerStyle() eq 1}selected="selected"{/if}>{'Net Attacker'|t}</option>
								<option value="2" {if $extUserProf->getPlayerStyle() eq 2}selected="selected"{/if}>{'Aggresive Baseliner'|t}</option>
								<option value="3" {if $extUserProf->getPlayerStyle() eq 3}selected="selected"{/if}>{'Defensive Baseliner'|t}</option>
								<option value="4" {if $extUserProf->getPlayerStyle() eq 4}selected="selected"{/if}>{'Counter Pouncher'|t}</option>
								<option value="5" {if $extUserProf->getPlayerStyle() eq 5}selected="selected"{/if}>{'All Court Player'|t}</option>
							</select></td></tr>
					<tr><td class="label">{'Prefered court surface'|t}</td><td>
							<select name="prefered_court_surface" class="defSelect">
								<option value="1" {if $extUserProf->getPreferedCourtSurface() eq 1}selected="selected"{/if}>{'Clay'|t}</option>
								<option value="2" {if $extUserProf->getPreferedCourtSurface() eq 2}selected="selected"{/if}>{'Hard'|t}</option>
								<option value="3" {if $extUserProf->getPreferedCourtSurface() eq 3}selected="selected"{/if}>{'Grass'|t}</option>
								<option value="4" {if $extUserProf->getPreferedCourtSurface() eq 4}selected="selected"{/if}>{'Synthetic Grass'|t}</option>
								<option value="5" {if $extUserProf->getPreferedCourtSurface() eq 5}selected="selected"{/if}>{'Carpet'|t}</option>
							</select></td></tr>
				</table>
				
				<div class="clearBoth"></div>
				<br/>
				
				<table cellpadding="0" cellspacing="0" class="panelProfle panelProfileTabL" width="230" border="0">
					<tr><td class="label serveSpeed">{'Average 1st'|t}<br/>{'serve speed'|t}</td><td><input type="text" name="average_1" value="{$extUserProf->getAverage1()}" class="defInTxt serveSpeed"/> <span class="kmh">{if $_display_metric_system_type eq 1}{'mph'|t}{else}{'km/h'|t}{/if}</span></td></tr>
					<tr><td class="label serveSpeed">{'Average 2st'|t}<br/>{'serve speed'|t}</td><td><input type="text" name="average_2" value="{$extUserProf->getAverage2()}" class="defInTxt serveSpeed"/> <span class="kmh">{if $_display_metric_system_type eq 1}{'mph'|t}{else}{'km/h'|t}{/if}</span></td></tr>
				</table>
				
				<table cellpadding="0" cellspacing="0" class="panelProfle  panelProfileTabR" width="360" border="0">
					<tr><td class="label">{'Favourite tour player'|t}</td><td><input type="text" name="top_player" value="{$extUserProf->getTopPlayer()}" class="defInTxt"/></td></tr>
					<tr><td class="label">{'Favourite tournament'|t}</td><td><input type="text" name="tournament" value="{$extUserProf->getTournament()}" class="defInTxt"/></td></tr>
				</table>
				
				<div class="clearBoth"></div>
			</div></div>
			<div class="backgroundFrame640Bottom"></div>
			<div class="submitGroup">
				<input type="submit" value="{'save settings'|t}" name="extendedProfile" class="button"/>
			</div>
		
		</div>

		
		
		<div class="clearBoth"></div>


		<br />

		<div class="panel970">
			<div class="panelTabs">
				<div class="tabs">
					<a class="label" title="{'Profile visibility permissions'|t}">{'Profile visibility permissions'|t}</a>
				</div>
			</div>
			<div class="backgroundFrame970Top"></div>
			<div class="backgroundFrame970">
				<div>
					<table width="100%" cellpadding="0" cellspacing="5" border="0" class="panelProfle">
						<thead>
							<tr>
								<th class="label" align="right">{'Permission'|t}</th>
								<th class="label">{'Everyone'|t}</th>
								<th class="label">{'Logged users'|t}</th>
								<th class="label">{'Friends'|t}</th>
								<th class="label">{'Only me'|t}</th>
								<th class="label" align="right">{'Permission'|t}</th>
								<th class="label">{'Everyone'|t}</th>
								<th class="label">{'Logged users'|t}</th>
								<th class="label">{'Friends'|t}</th>
								<th class="label">{'Only me'|t}</th>
							</tr>
						</thead>
						<tbody>
							<tr>
								<td class="label">{'player profile'|t}</td>
								<td><input type="radio" name="permission[player_profile]" value="0" {if $permissions->getPlayerProfile() eq 0}checked="checked"{/if}  /></td>
								<td><input type="radio" name="permission[player_profile]" value="1" {if $permissions->getPlayerProfile() eq 1}checked="checked"{/if}  /></td>
								<td><input type="radio" name="permission[player_profile]" value="2" {if $permissions->getPlayerProfile() eq 2}checked="checked"{/if}  /></td>
								<td><input type="radio" name="permission[player_profile]" value="3" {if $permissions->getPlayerProfile() eq 3}checked="checked"{/if}  /></td>
								<td class="label">{'player extended profile'|t}</td>
								<td><input type="radio" name="permission[extended_player_profile]" value="0"  {if $permissions->getExtendedPlayerProfile() eq 0}checked="checked"{/if}  /></td>
								<td><input type="radio" name="permission[extended_player_profile]" value="1" {if $permissions->getExtendedPlayerProfile() eq 1}checked="checked"{/if}  /></td>
								<td><input type="radio" name="permission[extended_player_profile]" value="2" {if $permissions->getExtendedPlayerProfile() eq 2}checked="checked"{/if}  /></td>
								<td><input type="radio" name="permission[extended_player_profile]" value="3" {if $permissions->getExtendedPlayerProfile() eq 3}checked="checked"{/if}  /></td>
							</tr>
							<tr>
								<td class="label">{'galleries'|t}</td>
								<td><input type="radio" name="permission[galleries]" value="0" {if $permissions->getGalleries() eq 0}checked="checked"{/if}  /></td>
								<td><input type="radio" name="permission[galleries]" value="1" {if $permissions->getGalleries() eq 1}checked="checked"{/if} /></td>
								<td><input type="radio" name="permission[galleries]" value="2" {if $permissions->getGalleries() eq 2}checked="checked"{/if} /></td>
								<td><input type="radio" name="permission[galleries]" value="3" {if $permissions->getGalleries() eq 3}checked="checked"{/if} /></td>
								<td class="label">{'videos'|t}</td>
								<td><input type="radio" name="permission[videos]" value="0" {if $permissions->getVideos() eq 0}checked="checked"{/if}  /></td>
								<td><input type="radio" name="permission[videos]" value="1" {if $permissions->getVideos() eq 1}checked="checked"{/if} /></td>
								<td><input type="radio" name="permission[videos]" value="2" {if $permissions->getVideos() eq 2}checked="checked"{/if} /></td>
								<td><input type="radio" name="permission[videos]" value="3" {if $permissions->getVideos() eq 3}checked="checked"{/if} /></td>
							</tr>
							<tr>
								<td class="label">{'equipment'|t}</td>
								<td><input type="radio" name="permission[equipment]" value="0" {if $permissions->getEquipment() eq 0}checked="checked"{/if} /></td>
								<td><input type="radio" name="permission[equipment]" value="1" {if $permissions->getEquipment() eq 1}checked="checked"{/if} /></td>
								<td><input type="radio" name="permission[equipment]" value="2" {if $permissions->getEquipment() eq 2}checked="checked"{/if} /></td>
								<td><input type="radio" name="permission[equipment]" value="3" {if $permissions->getEquipment() eq 3}checked="checked"{/if} /></td>
								<td class="label">{'user activity'|t}</td>
								<td><input type="radio" name="permission[user_activity]" value="0" {if $permissions->getUserActivity() eq 0}checked="checked"{/if} /></td>
								<td><input type="radio" name="permission[user_activity]" value="1" {if $permissions->getUserActivity() eq 1}checked="checked"{/if} /></td>
								<td><input type="radio" name="permission[user_activity]" value="2" {if $permissions->getUserActivity() eq 2}checked="checked"{/if} /></td>
								<td><input type="radio" name="permission[user_activity]" value="3" {if $permissions->getUserActivity() eq 3}checked="checked"{/if} /></td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
			<div class="backgroundFrame970Bottom"></div>
			<div class="submitGroup">
				<input type="submit" value="{'save settings'|t}" name="profilePermission" class="button"/>
			</div>
		</div>
		<div class="clearBoth"></div>
		</form>